from django import forms
from pacs.models import goalScoringWays

class AddFullTaskManipulator(forms.Manipulator):
	def __init__(self):
		self.fields = \
				(
					forms.TextField(field_name="slug",is_required = True,length=33,maxlength=32),
					forms.TextField(field_name="name",is_required = True,length=64,maxlength=65),
					forms.DatetimeField(field_name="startTime"),
					forms.DatetimeField(field_name="endTime"),
					forms.LargeTextField(field_name="description",is_required = True),
					forms.LargeTextField(field_name="input",is_required = True),
					forms.LargeTextField(field_name="output",is_required = True),
					forms.LargeTextField(field_name="testExamples",is_required = True),
				)

class AddContestManipulator(forms.Manipulator):
	def __init__(self):
		self.fields = \
				(
					forms.TextField(field_name="name",is_required = True,length=64,maxlength=65),
					forms.TextField(field_name="slug",is_required = True,length=33,maxlength=32),
					forms.DatetimeField(field_name="startTime"),
				)

class AddGoalManipulator(forms.Manipulator):
	def __init__(self):
		self.fields = \
				(
					forms.TextField(field_name="maxPoints",is_required = True),
					forms.DatetimeField(field_name="resultsTime",is_required=True),
					forms.SelectField(field_name="scoringWay",choices=goalScoringWays,is_required=True),
					forms.TextField(field_name="tests"),
				)

class AddTestManipulator(forms.Manipulator):
	def __init__(self):
		self.fields = \
				(
					forms.IntegerField(field_name="problem",is_required = True),
					forms.TextField(field_name="name",is_required = True),
					forms.IntegerField(field_name="maxTime",is_required = True),
					forms.IntegerField(field_name="maxMem",is_required = True),
					forms.FileUploadField(field_name="input",is_required = True),
					forms.FileUploadField(field_name="output",is_required = True),
				)
